<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>发布整车管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			// 全选操作
			$('#allCheck').click(function(){
				var checked = $(this).attr('checked');
				if(checked == 'checked'){
					$('.check').each(function(){
						$(this).attr('checked','checked');
					});
					$(this).attr('checked','checked');
				} else {
					$('.check').each(function(){
						$(this).removeAttr('checked');
					});
					$(this).removeAttr('checked');
				}
			});
			$('.check').click(function(){
				if($('.check:checked').length == $('.check').length){
					$('#allCheck').attr('checked','checked');
				} else {
					$('#allCheck').removeAttr('checked');
				}
			});
		});
		// 操作选中的旅行商
		function selectedVals(){
			var val='';
			$('.check:checked').each(function(){
				val+=$(this).attr('data-id')+',';
			});
			if(val!=''){ // 去掉多余的","
				val = val.substr(0,val.length-1);
			}
			return val;
		}
	</script>
</head>
<body>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th width="35px;"><input id="allCheck" type="checkbox" ${all }/></th>
				<th>旅行商名称</th>
				<th>旅行商类型</th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${officeList}" var="office">
			<tr>
				<td width="35px;"><input type="checkbox" class="check" data-id="${office.id }" ${office.checked }/></td>
				<td>
					${office.name}
				</td>
				<td>${fns:getDictLabel(office.parnertype, 'company', '无')}</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
</body>
</html>